﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="FoodLight.DetailPage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FoodLight"
    xmlns:common="using:FoodLight.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.TopAppBar>
        <AppBar x:Name="appBar2" Padding="10,0,10,0" Background="#AC000000" BorderBrush="{x:Null}" MinHeight="88">
            <Grid Margin="0" >
                <StackPanel Margin="110,10,0,10" Orientation="Horizontal" HorizontalAlignment="Left" Height="90">
                    <Button x:Name="btnTopApp" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="0" Style="{StaticResource TopButton}" Tapped="btnTopApp_Tapped_1">
                        <Image Width="85" Height="88" Source="Assets/TopApp1.png"/>
                    </Button>
                    <Button x:Name="btnTopApp2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="0" Style="{StaticResource TopButton}" Margin="10,0,0,0">
                        <Image Width="85" Height="88" Source="Assets/TopApp2.png"/>
                    </Button>
                    <Button x:Name="btnTopApp3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="0" Style="{StaticResource TopButton}" Margin="10,0,0,0">
                        <Image Width="85" Height="88" Source="Assets/TopApp3.png"/>
                    </Button>
                    <Button x:Name="btnTopApp4" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="0" Style="{StaticResource TopButton}" Margin="10,0,0,0">
                        <Image Width="85" Height="88" Source="Assets/TopApp4.png"/>
                    </Button>
                </StackPanel>
            </Grid>
        </AppBar>
    </Page.TopAppBar>


    <Page.Resources>

        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">My Application</x:String>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Style="{StaticResource LayoutRootStyle}" Margin="0" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <ScrollViewer x:Name="scrollViewer" Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" ZoomMode="Disabled" VerticalScrollMode="Disabled">
            <ScrollViewer.Background>
                <ImageBrush ImageSource="Assets/Bg2.png"/>
            </ScrollViewer.Background>
            <Grid x:Name="ContanerGrid" Margin="120,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="500"/>
                    <ColumnDefinition Width="25"/>
                    <ColumnDefinition Width="302"/>
                    <ColumnDefinition Width="25"/>
                    <ColumnDefinition Width="630"/>
                    <ColumnDefinition Width="40"/>
                </Grid.ColumnDefinitions>
                <Grid x:Name="ImageGrid">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40"/>
                        <RowDefinition Height="511"/>
                    </Grid.RowDefinitions>
                    <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Prawn Salad" VerticalAlignment="Top" FontFamily="Segoe UI" FontSize="30" Foreground="#FF222222" FontWeight="Light"/>
                    <Image Grid.Row="1" Source="Assets/HubPage/Recipes1.png" VerticalAlignment="Top" Margin="0" HorizontalAlignment="Left" Height="511" Stretch="Fill"/>
                </Grid>
                <Grid x:Name="IngredientsGrid" Grid.Column="2" Height="546" VerticalAlignment="Top">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40"/>
                        <RowDefinition Height="507*"/>
                    </Grid.RowDefinitions>
                    <Grid x:Name="InnerGrid" Grid.RowSpan="2" Grid.Row="1" Background="#FF309FC3">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="64"/>
                            <RowDefinition Height="150*"/>
                        </Grid.RowDefinitions>
                        <StackPanel Grid.RowSpan="2" Grid.Row="1" Margin="15,0,10,0">
                            <TextBlock TextWrapping="Wrap" Text="1/2 teaspoon Seasoning - Salt" FontFamily="Segoe UI" FontSize="14" FontWeight="Light" Margin="0,0,0,10"/>
                            <TextBlock TextWrapping="Wrap" Text="1/2 Bell Pepper - Red, chopped" FontFamily="Segoe UI" FontSize="14" FontWeight="Light" Margin="0,0,0,10"/>
                            <TextBlock TextWrapping="Wrap" Text="1 teaspoon Garlic, minced" FontFamily="Segoe UI" FontSize="14" FontWeight="Light" Margin="0,0,0,10"/>
                            <TextBlock TextWrapping="Wrap" Text="1 Onions, chopped" FontFamily="Segoe UI" FontSize="14" FontWeight="Light" Margin="0,0,0,10"/>
                            <TextBlock TextWrapping="Wrap" Text="2 flour tortillas" FontFamily="Segoe UI" FontSize="14" FontWeight="Light" Margin="0,0,0,10"/>
                            <TextBlock TextWrapping="Wrap" Text="2 tablespoons vegetable oil" FontFamily="Segoe UI" FontSize="14" FontWeight="Light" Margin="0,0,0,10"/>
                            <TextBlock TextWrapping="Wrap" Text="1 teaspoon minced jalapeno peppers
Cilantro" FontFamily="Segoe UI" FontSize="14" FontWeight="Light"/>
                            <TextBlock TextWrapping="Wrap" Text="3 ounces cream cheese" FontFamily="Segoe UI" FontSize="14" FontWeight="Light" Margin="0,0,0,10"/>
                            <TextBlock TextWrapping="Wrap" Text="1 (15 ounce) can black beans, rinsed and drained" FontFamily="Segoe UI" FontSize="14" FontWeight="Light" Margin="0,0,0,10"/>
                        </StackPanel>
                        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Ingredients" VerticalAlignment="Center" FontFamily="Segoe UI" FontSize="30" Margin="15,0,0,0" FontWeight="Light"/>
                    </Grid>
                </Grid>
                <Grid Grid.Column="4">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40"/>
                        <RowDefinition Height="549*"/>
                    </Grid.RowDefinitions>
                    <Grid x:Name="InstructionsGrid" Background="#FF444444" Margin="0" Height="507" VerticalAlignment="Top" Grid.Row="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="64"/>
                            <RowDefinition Height="150*"/>
                        </Grid.RowDefinitions>
                        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Instructions" VerticalAlignment="Center" FontFamily="Segoe UI" FontSize="30" Margin="15,0,0,0" FontWeight="Light"/>
                        <Grid x:Name="INdInnerGrid" Grid.RowSpan="2" Grid.Row="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="281"/>
                                <ColumnDefinition Width="45"/>
                                <ColumnDefinition Width="54*"/>
                            </Grid.ColumnDefinitions>
                            <StackPanel Margin="15,0,10,0">
                                <TextBlock TextWrapping="Wrap" Text="1. Wrap tortillas in foil and place in oven heated to 350 degrees F (175 degrees C). Bake for 15 minutes or until heated through." Margin="0,0,0,10" FontFamily="Segoe UI" FontSize="14"/>
                                <TextBlock TextWrapping="Wrap" Text="2. Wrap tortillas in foil and place in oven heated to 350 degrees F (175 degrees C). Bake for 15 minutes or until heated through." Margin="0,0,0,10" FontFamily="Segoe UI" FontSize="14"/>
                                <TextBlock TextWrapping="Wrap" Text="3. Wrap tortillas in foil and place in oven heated to 350 degrees F (175 degrees C). Bake for 15 minutes or until heated through." Margin="0,0,0,10" FontFamily="Segoe UI" FontSize="14"/>
                                <TextBlock TextWrapping="Wrap" Text="4. Wrap tortillas in foil and place in oven heated to 350 degrees F (175 degrees C). Bake for 15 minutes or until heated through." Margin="0,0,0,10" FontFamily="Segoe UI" FontSize="14"/>
                            </StackPanel>
                            <StackPanel Margin="15,0,20,0" Grid.Column="2">
                                <TextBlock TextWrapping="Wrap" Text="5. Wrap tortillas in foil and place in oven heated to 350 degrees F (175 degrees C). Bake for 15 minutes or until heated through." Margin="0,0,0,10" FontFamily="Segoe UI" FontSize="14"/>
                                <TextBlock TextWrapping="Wrap" Text="6. Wrap tortillas in foil and place in oven heated to 350 degrees F (175 degrees C). Bake for 15 minutes or until heated through." Margin="0,0,0,10" FontFamily="Segoe UI" FontSize="14"/>
                                <TextBlock TextWrapping="Wrap" Text="7. Wrap tortillas in foil and place in oven heated to 350 degrees F (175 degrees C). Bake for 15 minutes or until heated through." Margin="0,0,0,10" FontFamily="Segoe UI" FontSize="14"/>
                                <TextBlock TextWrapping="Wrap" Text="8. Wrap tortillas in foil and place in oven heated to 350 degrees F (175 degrees C). Bake for 15 minutes or until heated through." Margin="0,0,0,10" FontFamily="Segoe UI" FontSize="14"/>
                            </StackPanel>
                        </Grid>
                    </Grid>
                </Grid>
            </Grid>
        </ScrollViewer>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" IsHitTestVisible="false" Style="{StaticResource PageHeaderTextStyle}" Foreground="#DE000000" Text="Recipes"/>
            <Grid x:Name="LogoGrid" HorizontalAlignment="Right" Height="100" VerticalAlignment="Center" Width="234" Grid.Column="1" Margin="0,0,40,0">
                <Image Source="Assets/AppLogo.png"/>
            </Grid>
        </Grid>
        <Grid x:Name="SnapedGrid" Grid.RowSpan="2">
            <TextBlock x:Name="textBlock" HorizontalAlignment="Center" TextWrapping="Wrap" Text="Please switch to full screen to view the details." VerticalAlignment="Center" FontFamily="Segoe UI" FontSize="24" Foreground="Black" Margin="10,0"/>
        </Grid>

        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup x:Name="ApplicationViewStates">
                <VisualState x:Name="FullScreenLandscape">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="textBlock">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Filled">
                	<Storyboard>
                		<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="textBlock">
                			<DiscreteObjectKeyFrame KeyTime="0">
                				<DiscreteObjectKeyFrame.Value>
                					<Visibility>Collapsed</Visibility>
                				</DiscreteObjectKeyFrame.Value>
                			</DiscreteObjectKeyFrame>
                		</ObjectAnimationUsingKeyFrames>
                	</Storyboard>
                </VisualState>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="textBlock">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>

                <!-- The back button and title have different styles when snapped -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="LogoGrid">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="scrollViewer">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="textBlock">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="appBar2">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="pageTitle">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="LogoGrid">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <x:Double>190</x:Double>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="LogoGrid">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Thickness>0,10,40,-5</Thickness>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</common:LayoutAwarePage>
